//NOTE: trait Copy dependent to Clone 
// impl Clone first & impl Copy next

#[derive(Debug, Clone, Copy)]
struct Unit;


#[derive(Debug, Clone)]
struct Pair( Box<i32>, Box<i32>);


pub fn main(){
    let unit = Unit;
    println!("original : {:?}", unit);

    let copied_unit = unit;
    println!("copy: {:?}", copied_unit);

    let pair = Pair(Box::new(1), Box::new(2));
    println!("original: {:?}", pair);

    let moved_pair = pair;
    println!("moved: {:?}", moved_pair);
    //Error: println!("original: {:?}", pair);
    
    let cloned_pair = moved_pair.clone();
    drop(moved_pair);
    //Error: println!("moved_pair is dropped: {:?}", moved_pair);
    
    println!("clone: {:?}", cloned_pair); 
}
